Add automated testing infrastructure for Ubuntu bootstrap#5
Conversation
- Add Docker-based testing with clean Ubuntu environments - Add Makefile with convenient test targets (test, test-interactive, test-all, etc.) - Add test runner scripts for automated and manual testing - Add GitHub Actions workflow for CI/CD testing on multiple Ubuntu versions - Add comprehensive testing documentation - Add QEMU testing setup for full system testing - Support testing Ubuntu 20.04, 22.04, and 24.04 Testing can now be run safely on clean Ubuntu installs without affecting the dev system.
There was a problem hiding this comment.
Pull request overview
This PR adds comprehensive automated testing infrastructure for Ubuntu bootstrap scripts to enable safe testing without affecting development systems. The testing approach uses Docker for fast package installation validation and provides QEMU documentation for full system testing.
Key changes:
- Docker-based test environments with interactive and automated modes for Ubuntu 20.04, 22.04, and 24.04
- Makefile with convenient test targets and GitHub Actions workflow for CI/CD
- Comprehensive testing documentation covering Docker, QEMU, and various testing strategies
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 14 comments.
Show a summary per file
| File | Description |
|---|---|
| test/run-tests.sh | Main test runner script supporting interactive, automated, and syntax-check modes across multiple Ubuntu versions |
| test/monitor-test.sh | Test monitoring script that logs output for debugging |
| test/docker/Dockerfile.ubuntu | Interactive Docker environment for manual testing of bootstrap scripts |
| test/docker/Dockerfile.ubuntu-noninteractive | Automated Docker environment that runs bootstrap tests non-interactively |
| test/docker/.dockerignore | Excludes test artifacts and documentation from Docker images |
| test/README.md | Comprehensive testing documentation with Docker/QEMU comparison and workflow recommendations |
| test/qemu/README.md | QEMU setup guide for full system-level testing with cloud-init automation |
| Makefile | Convenient test targets (test, test-all, lint, clean) for local development |
| .github/workflows/test-ubuntu.yml | CI/CD workflow testing bootstrap scripts on multiple Ubuntu versions |
| echo -e "\n${GREEN}✓ All syntax checks passed${NC}\n" | ||
|
|
||
| if command -v shellcheck &> /dev/null; then | ||
| print_header "Running ShellCheck" |
There was a problem hiding this comment.
The shellcheck command at line 123 uses || print_warning which means it will always succeed even if shellcheck finds issues. This inconsistency with the earlier syntax checks (which properly fail on errors due to set -e) may be intentional but should be documented. Consider either making shellcheck failures hard errors or adding a comment explaining why shellcheck warnings don't fail the build.
| print_header "Running ShellCheck" | |
| print_header "Running ShellCheck" | |
| # ShellCheck is treated as advisory linting: keep syntax errors as hard failures | |
| # via 'set -e' above, but do not fail the overall test run on style warnings here. |
- Add error handling (|| exit) to all pushd/popd/cd commands - Quote all $HOME and $USER variables to prevent word splitting - Fixes SC2164 warnings in ubuntu/install-makemkv - Fixes SC2164 warning in generic/auto-cpufreq - Fixes SC2086 warnings in generic/create-directories, install-zsh-customizations, and add-user-to-groups Remaining SC1090/SC1091 warnings are expected (documented in .shellcheckrc)
Fix GitHub Actions workflow to skip .md files when running shellcheck
- ci.yml: Exclude .md files when finding bash scripts - test-ubuntu.yml: Exclude .md files in both shellcheck and syntax verification
Drop testing of older versions (20.04, 22.04) and focus on current LTS (24.04) and latest (25.10)
- Update test runner usage/help and default Ubuntu versions to 24.04/25.10 - Document ShellCheck advisory behavior and PIPESTATUS bashism - Convert noninteractive Dockerfile runner to heredoc for readability - Make CI ShellCheck fail on errors; drop redundant smoke test job - Makefile: align versions and enforce shellcheck with severity=error
- Download pinned v2.2.2 archive with SHA256 verification - Remove git clone of HEAD to reduce supply-chain risk - Install from verified, versioned source
Fix 'Bash syntax + ShellCheck' workflow to skip Dockerfile* files
Testing can now be run safely on clean Ubuntu installs without affecting the dev system.